home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / comm / tcp / rxsocket.lha / rxsocket / examples / interface.rexx < prev    next >
OS/2 REXX Batch file  |  2000-11-28  |  1KB  |  47 lines

  1. /*
  2.     HOW TO QUERY INTERFACES
  3. */
  4.  
  5. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  6. if AddLibrary("rexxsupport.library","rxsocket.library")~=0 then exit
  7.  
  8. res=QueryInterfaces("IN")
  9. if res<0 then do
  10.     say "cannot query ("errno()")"
  11.     exit
  12. end
  13. if res==0 then do
  14.     say "no interface (!?!)"
  15.     exit
  16. end
  17.  
  18. say "Found:" res "interface(s)"
  19. do i=0 to res-1
  20.     say "---------------"i+1"---------------"
  21.     say "Name:  " in.i.NAME
  22.     say "AFAddr:" in.i.IFADDRS
  23.     if in.i.PPADDR~="" then say "PPAddr:" in.i.PPADDR
  24.     if in.i.BADDR~="" then say "Baddr: " in.i.BADDR
  25.     if in.i.NMASK~="" then say "NMask: " in.i.NMASK
  26.     if in.i.METRIC~="" then say "Metric:" in.i.METRIC
  27.     if in.i.MTU~="" then say "MTU:   " in.i.MTU
  28.     if in.i.IFWIRE~="" then say "IFWire:" in.i.IFWIRE
  29.     say "Flags: " in.i.FLAGS":"
  30.     if in.i.UP then say " UP"
  31.     if in.i.BROADCAST then say " BROADCAST"
  32.     if in.i.DEBUG then say " DEBUG"
  33.     if in.i.LOOPBACK then say " LOOPBACK"
  34.     if in.i.POINTTOPOINT then say " POINTTOPOINT"
  35.     if in.i.NOTRAILERS then say " NOTRAILERS"
  36.     if in.i.RUNNING then say " RUNNING"
  37.     if in.i.NOARP then say " NOARP"
  38.     if in.i.PROMISC then say " PROMISC"
  39.     if in.i.ALLMULTI then say " ALLMULTI"
  40.     if in.i.OACTIVE then say " OACTIVE"
  41.     if in.i.SIMPLEX then say " SIMPLEX"
  42.     if in.i.LINK0 then say " LINK0"
  43.     if in.i.LINK1 then say " LINK1"
  44.     if in.i.LINK2 then say " LINK2"
  45.     if in.i.MULTICAST then say " MULTICAST"
  46. end
  47.